<!doctype html>
<html lang="en" dir="ltr">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<meta name="generator" content="Docusaurus v2.0.0-alpha.72">
<link rel="alternate" type="application/rss+xml" href="/zh-cn.neutralinojs.github.io/blog/rss.xml" title="Neutralinojs Blog RSS Feed">
<link rel="alternate" type="application/atom+xml" href="/zh-cn.neutralinojs.github.io/blog/atom.xml" title="Neutralinojs Blog Atom Feed">
<link rel="preconnect" href="https://www.google-analytics.com">
<link rel="preconnect" href="https://www.googletagmanager.com">
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-120983955-1"></script>
<script>function gtag(){dataLayer.push(arguments)}window.dataLayer=window.dataLayer||[],gtag("js",new Date),gtag("config","UA-120983955-1",{anonymize_ip:!0})</script>
<script src="https://media.ethicalads.io/media/client/ethicalads.min.js"></script>
<script src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js" async></script><title data-react-helmet="true">Neutralino.os | Neutralinojs</title><meta data-react-helmet="true" property="og:url" content="https://wll8.gitee.io/zh-cn.neutralinojs.github.io/zh-cn.neutralinojs.github.io/docs/api/os"><meta data-react-helmet="true" name="docusaurus_locale" content="en"><meta data-react-helmet="true" name="docusaurus_version" content="current"><meta data-react-helmet="true" name="docusaurus_tag" content="docs-default-current"><meta data-react-helmet="true" property="og:title" content="Neutralino.os | Neutralinojs"><meta data-react-helmet="true" name="description" content="Neutralino.os 命名空间包含与用户操作系统相关的方法。"><meta data-react-helmet="true" property="og:description" content="Neutralino.os 命名空间包含与用户操作系统相关的方法。"><link data-react-helmet="true" rel="shortcut icon" href="/zh-cn.neutralinojs.github.io/img/favicon.png"><link data-react-helmet="true" rel="canonical" href="https://wll8.gitee.io/zh-cn.neutralinojs.github.io/zh-cn.neutralinojs.github.io/docs/api/os"><link data-react-helmet="true" rel="alternate" href="https://wll8.gitee.io/zh-cn.neutralinojs.github.io/zh-cn.neutralinojs.github.io/docs/api/os" hreflang="en"><link data-react-helmet="true" rel="alternate" href="https://wll8.gitee.io/zh-cn.neutralinojs.github.io/zh-cn.neutralinojs.github.io/docs/api/os" hreflang="x-default"><link rel="stylesheet" href="/zh-cn.neutralinojs.github.io/assets/css/styles.b7ecac1c.css">
<link rel="preload" href="/zh-cn.neutralinojs.github.io/assets/js/styles.c25d7c9f.js" as="script">
<link rel="preload" href="/zh-cn.neutralinojs.github.io/assets/js/runtime~main.da1bdab8.js" as="script">
<link rel="preload" href="/zh-cn.neutralinojs.github.io/assets/js/main.22927eab.js" as="script">
<link rel="preload" href="/zh-cn.neutralinojs.github.io/assets/js/1.a80d899d.js" as="script">
<link rel="preload" href="/zh-cn.neutralinojs.github.io/assets/js/2.818fc9a7.js" as="script">
<link rel="preload" href="/zh-cn.neutralinojs.github.io/assets/js/49.8e895b96.js" as="script">
<link rel="preload" href="/zh-cn.neutralinojs.github.io/assets/js/50.816652b0.js" as="script">
<link rel="preload" href="/zh-cn.neutralinojs.github.io/assets/js/935f2afb.a67ede05.js" as="script">
<link rel="preload" href="/zh-cn.neutralinojs.github.io/assets/js/17896441.74f92a0c.js" as="script">
<link rel="preload" href="/zh-cn.neutralinojs.github.io/assets/js/f2d4af26.54def32b.js" as="script">
</head>
<body>
<script>!function(){function t(t){document.documentElement.setAttribute("data-theme",t)}var e=function(){var t=null;try{t=localStorage.getItem("theme")}catch(t){}return t}();t(null!==e?e:"light")}()</script><div id="__docusaurus">
<div><a href="#main" class="skipToContent_1oUP">Skip to main content</a></div><nav class="navbar navbar--fixed-top"><div class="navbar__inner"><div class="navbar__items"><button aria-label="Navigation bar toggle" class="navbar__toggle" type="button" tabindex="0"><svg aria-label="Menu" width="30" height="30" viewBox="0 0 30 30" role="img" focusable="false"><title>Menu</title><path stroke="currentColor" stroke-linecap="round" stroke-miterlimit="10" stroke-width="2" d="M4 7h22M4 15h22M4 23h22"></path></svg></button><a class="navbar__brand" href="/zh-cn.neutralinojs.github.io/"><img src="/zh-cn.neutralinojs.github.io/img/logo.png" alt="Neutralinojs Logo" class="themedImage_1VuW themedImage--light_3UqQ navbar__logo"><img src="/zh-cn.neutralinojs.github.io/img/logo.png" alt="Neutralinojs Logo" class="themedImage_1VuW themedImage--dark_hz6m navbar__logo"><strong class="navbar__title">Neutralinojs</strong></a><a aria-current="page" class="navbar__item navbar__link navbar__link--active" href="/zh-cn.neutralinojs.github.io/docs/">文档</a><a class="navbar__item navbar__link" href="/zh-cn.neutralinojs.github.io/apps/">应用</a><a class="navbar__item navbar__link" href="/zh-cn.neutralinojs.github.io/resources/">资源</a><a href="https://www.youtube.com/c/CodeZri" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link">视频</a><a href="https://codezri.org/blog/neutralinojs-2024-roadmap" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link">路线图</a><a class="navbar__item navbar__link" href="/zh-cn.neutralinojs.github.io/docs/release-notes/framework">发布说明</a><a href="https://github.com/neutralinojs/gsoc2024" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link">GSoC 2024</a></div><div class="navbar__items navbar__items--right"><a href="https://github.com/neutralinojs" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link">GitHub</a><a href="https://www.patreon.com/shalithasuranga" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link">❤️ 捐赠</a><div class="react-toggle react-toggle--disabled displayOnlyInLargeViewport_GrZ2"><div class="react-toggle-track"><div class="react-toggle-track-check"><span class="toggle_71bT">🌜</span></div><div class="react-toggle-track-x"><span class="toggle_71bT">🌞</span></div></div><div class="react-toggle-thumb"></div><input type="checkbox" disabled="" aria-label="Dark mode toggle" class="react-toggle-screenreader-only"></div></div></div><div role="presentation" class="navbar-sidebar__backdrop"></div><div class="navbar-sidebar"><div class="navbar-sidebar__brand"><a class="navbar__brand" href="/zh-cn.neutralinojs.github.io/"><img src="/zh-cn.neutralinojs.github.io/img/logo.png" alt="Neutralinojs Logo" class="themedImage_1VuW themedImage--light_3UqQ navbar__logo"><img src="/zh-cn.neutralinojs.github.io/img/logo.png" alt="Neutralinojs Logo" class="themedImage_1VuW themedImage--dark_hz6m navbar__logo"><strong class="navbar__title">Neutralinojs</strong></a></div><div class="navbar-sidebar__items"><div class="menu"><ul class="menu__list"><li class="menu__list-item"><a aria-current="page" class="menu__link navbar__link--active" href="/zh-cn.neutralinojs.github.io/docs/">文档</a></li><li class="menu__list-item"><a class="menu__link" href="/zh-cn.neutralinojs.github.io/apps/">应用</a></li><li class="menu__list-item"><a class="menu__link" href="/zh-cn.neutralinojs.github.io/resources/">资源</a></li><li class="menu__list-item"><a href="https://www.youtube.com/c/CodeZri" target="_blank" rel="noopener noreferrer" class="menu__link">视频</a></li><li class="menu__list-item"><a href="https://codezri.org/blog/neutralinojs-2024-roadmap" target="_blank" rel="noopener noreferrer" class="menu__link">路线图</a></li><li class="menu__list-item"><a class="menu__link" href="/zh-cn.neutralinojs.github.io/docs/release-notes/framework">发布说明</a></li><li class="menu__list-item"><a href="https://github.com/neutralinojs/gsoc2024" target="_blank" rel="noopener noreferrer" class="menu__link">GSoC 2024</a></li><li class="menu__list-item"><a href="https://github.com/neutralinojs" target="_blank" rel="noopener noreferrer" class="menu__link">GitHub</a></li><li class="menu__list-item"><a href="https://www.patreon.com/shalithasuranga" target="_blank" rel="noopener noreferrer" class="menu__link">❤️ 捐赠</a></li></ul></div></div></div></nav><div class="main-wrapper main-docs-wrapper"><div class="docPage_31aa"><div class="docSidebarContainer_3Kbt" role="complementary"><div class="sidebar_15mo"><div class="menu menu--responsive thin-scrollbar menu_Bmed"><button aria-label="Open menu" aria-haspopup="true" class="button button--secondary button--sm menu__button" type="button"><svg aria-label="Menu" class="sidebarMenuIcon_fgN0" width="24" height="24" viewBox="0 0 30 30" role="img" focusable="false"><title>Menu</title><path stroke="currentColor" stroke-linecap="round" stroke-miterlimit="10" stroke-width="2" d="M4 7h22M4 15h22M4 23h22"></path></svg></button><ul class="menu__list"><li class="menu__list-item menu__list-item--collapsed"><a class="menu__link menu__link--sublist" href="#!">入门指南</a><ul class="menu__list"><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/zh-cn.neutralinojs.github.io/docs/">简介</a></li><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/zh-cn.neutralinojs.github.io/docs/getting-started/your-first-neutralinojs-app">您的第一个Neutralinojs应用</a></li><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/zh-cn.neutralinojs.github.io/docs/getting-started/using-frontend-libraries">使用前端库</a></li></ul></li><li class="menu__list-item"><a class="menu__link menu__link--sublist menu__link--active" href="#!">原生 API</a><ul class="menu__list"><li class="menu__list-item"><a class="menu__link" tabindex="0" href="/zh-cn.neutralinojs.github.io/docs/api/overview">原生API概览</a></li><li class="menu__list-item"><a class="menu__link" tabindex="0" href="/zh-cn.neutralinojs.github.io/docs/api/app">Neutralino.app</a></li><li class="menu__list-item"><a class="menu__link" tabindex="0" href="/zh-cn.neutralinojs.github.io/docs/api/clipboard">Neutralino.clipboard</a></li><li class="menu__list-item"><a class="menu__link" tabindex="0" href="/zh-cn.neutralinojs.github.io/docs/api/computer">Neutralino.computer</a></li><li class="menu__list-item"><a class="menu__link" tabindex="0" href="/zh-cn.neutralinojs.github.io/docs/api/custom">Neutralino.custom</a></li><li class="menu__list-item"><a class="menu__link" tabindex="0" href="/zh-cn.neutralinojs.github.io/docs/api/debug">Neutralino.debug</a></li><li class="menu__list-item"><a class="menu__link" tabindex="0" href="/zh-cn.neutralinojs.github.io/docs/api/events">Neutralino.events</a></li><li class="menu__list-item"><a class="menu__link" tabindex="0" href="/zh-cn.neutralinojs.github.io/docs/api/extensions">Neutralino.extensions</a></li><li class="menu__list-item"><a class="menu__link" tabindex="0" href="/zh-cn.neutralinojs.github.io/docs/api/filesystem">Neutralino.filesystem</a></li><li class="menu__list-item"><a class="menu__link" tabindex="0" href="/zh-cn.neutralinojs.github.io/docs/api/init">Neutralino.init</a></li><li class="menu__list-item"><a aria-current="page" class="menu__link menu__link--active active" tabindex="0" href="/zh-cn.neutralinojs.github.io/docs/api/os">Neutralino.os</a></li><li class="menu__list-item"><a class="menu__link" tabindex="0" href="/zh-cn.neutralinojs.github.io/docs/api/storage">Neutralino.storage</a></li><li class="menu__list-item"><a class="menu__link" tabindex="0" href="/zh-cn.neutralinojs.github.io/docs/api/updater">Neutralino.updater</a></li><li class="menu__list-item"><a class="menu__link" tabindex="0" href="/zh-cn.neutralinojs.github.io/docs/api/window">Neutralino.window</a></li><li class="menu__list-item"><a class="menu__link" tabindex="0" href="/zh-cn.neutralinojs.github.io/docs/api/error-codes">错误码</a></li><li class="menu__list-item"><a class="menu__link" tabindex="0" href="/zh-cn.neutralinojs.github.io/docs/api/global-variables">全局变量</a></li></ul></li><li class="menu__list-item menu__list-item--collapsed"><a class="menu__link menu__link--sublist" href="#!">CLI</a><ul class="menu__list"><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/zh-cn.neutralinojs.github.io/docs/cli/neu-cli">neu CLI</a></li><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/zh-cn.neutralinojs.github.io/docs/cli/internal-cli-arguments">Internal 命令行参数</a></li></ul></li><li class="menu__list-item menu__list-item--collapsed"><a class="menu__link menu__link--sublist" href="#!">配置</a><ul class="menu__list"><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/zh-cn.neutralinojs.github.io/docs/configuration/neutralino.config.json">neutralino.config.json</a></li><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/zh-cn.neutralinojs.github.io/docs/configuration/project-structure">项目结构</a></li><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/zh-cn.neutralinojs.github.io/docs/configuration/modes">模式</a></li></ul></li><li class="menu__list-item menu__list-item--collapsed"><a class="menu__link menu__link--sublist" href="#!">如何操作</a><ul class="menu__list"><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/zh-cn.neutralinojs.github.io/docs/how-to/extensions-overview">扩展概述</a></li><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/zh-cn.neutralinojs.github.io/docs/how-to/auto-updater">自动更新器</a></li></ul></li><li class="menu__list-item menu__list-item--collapsed"><a class="menu__link menu__link--sublist" href="#!">分发</a><ul class="menu__list"><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/zh-cn.neutralinojs.github.io/docs/distribution/overview">分发概述</a></li></ul></li><li class="menu__list-item menu__list-item--collapsed"><a class="menu__link menu__link--sublist" href="#!">贡献</a><ul class="menu__list"><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/zh-cn.neutralinojs.github.io/docs/contributing/framework-developer-guide">框架开发指南</a></li><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/zh-cn.neutralinojs.github.io/docs/contributing/architecture">架构</a></li><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/zh-cn.neutralinojs.github.io/docs/contributing/security">安全性</a></li><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/zh-cn.neutralinojs.github.io/docs/contributing/code-style-guide">代码风格指南</a></li><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/zh-cn.neutralinojs.github.io/docs/contributing/developer-support">开发者支持</a></li><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/zh-cn.neutralinojs.github.io/docs/contributing/committers">提交者</a></li><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/zh-cn.neutralinojs.github.io/docs/contributing/frequently-asked-questions">常见问题解答</a></li><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/zh-cn.neutralinojs.github.io/docs/contributing/about-neutralinojs">关于 Neutralinojs</a></li></ul></li><li class="menu__list-item menu__list-item--collapsed"><a class="menu__link menu__link--sublist" href="#!">发布说明</a><ul class="menu__list"><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/zh-cn.neutralinojs.github.io/docs/release-notes/framework">框架</a></li><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/zh-cn.neutralinojs.github.io/docs/release-notes/cli">命令行</a></li><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/zh-cn.neutralinojs.github.io/docs/release-notes/client-library">客户端</a></li></ul></li></ul></div></div></div><main class="docMainContainer_3ufF"><div class="container padding-vert--lg docItemWrapper_3FMP"><div class="row"><div class="col docItemCol_2rXS"><div class="docItemContainer_1EXp"><article><header><h1 class="docTitle_1vX4">Neutralino.os</h1></header><div class="markdown"><p><code>Neutralino.os</code> 命名空间包含与用户操作系统相关的方法。</p><h2><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="osexeccommandcommand-options"></a>os.execCommand(command, options)<a class="hash-link" href="#osexeccommandcommand-options" title="Direct link to heading">#</a></h2><p>执行一个命令并返回输出。</p><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="parameters"></a>Parameters<a class="hash-link" href="#parameters" title="Direct link to heading">#</a></h3><ul><li><code>command</code> String: 将要执行的命令。</li></ul><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="options"></a>Options<a class="hash-link" href="#options" title="Direct link to heading">#</a></h3><ul><li><code>background</code> Boolean: 若设置为 <code>true</code>，则在后台执行命令并立即解析Promise。这个选项使得进程从API函数调用中分离，因此如果你需要稍后连接到新创建的进程，请考虑使用 <code>os.spawnProcess</code>。</li><li><code>stdIn</code> String: 标准输入字符串。</li><li><code>cwd</code> String: 当前工作目录。</li></ul><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="return-object-awaited"></a>Return Object (awaited):<a class="hash-link" href="#return-object-awaited" title="Direct link to heading">#</a></h3><ul><li><code>pid</code> Number: 进程标识符。</li><li><code>stdOut</code> String: 标准输出。</li><li><code>stdErr</code> String: 标准错误。</li><li><code>exitCode</code> Number: 进程的退出代码。</li></ul><div class="codeBlockContainer_K1bP"><div class="codeBlockContent_hGly js"><div tabindex="0" class="prism-code language-js codeBlock_23N8 thin-scrollbar"><div class="codeBlockLines_39YC" style="color:#bfc7d5;background-color:#292d3e"><div class="token-line" style="color:#bfc7d5"><span class="token keyword" style="font-style:italic">let</span><span class="token plain"> info </span><span class="token operator" style="color:rgb(137, 221, 255)">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="font-style:italic">await</span><span class="token plain"> </span><span class="token maybe-class-name">Neutralino</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token property-access">os</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token method function property-access" style="color:rgb(130, 170, 255)">execCommand</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string" style="color:rgb(195, 232, 141)">&#x27;python --version&#x27;</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><span class="token plain"></span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"></span><span class="token console class-name" style="color:rgb(255, 203, 107)">console</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token method function property-access" style="color:rgb(130, 170, 255)">log</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token template-string template-punctuation string" style="color:rgb(195, 232, 141)">`</span><span class="token template-string string" style="color:rgb(195, 232, 141)">你的Python版本：</span><span class="token template-string interpolation interpolation-punctuation punctuation" style="color:rgb(199, 146, 234)">${</span><span class="token template-string interpolation">info</span><span class="token template-string interpolation punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token template-string interpolation">stdOut</span><span class="token template-string interpolation interpolation-punctuation punctuation" style="color:rgb(199, 146, 234)">}</span><span class="token template-string template-punctuation string" style="color:rgb(195, 232, 141)">`</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><span class="token plain"></span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain" style="display:inline-block">
</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"></span><span class="token keyword control-flow" style="font-style:italic">await</span><span class="token plain"> </span><span class="token maybe-class-name">Neutralino</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token property-access">os</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token method function property-access" style="color:rgb(130, 170, 255)">execCommand</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string" style="color:rgb(195, 232, 141)">&#x27;npm start&#x27;</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><span class="token plain"> background</span><span class="token operator" style="color:rgb(137, 221, 255)">:</span><span class="token plain"> </span><span class="token boolean" style="color:rgb(255, 88, 116)">true</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span></div></div></div><button type="button" aria-label="Copy code to clipboard" class="copyButton_Ue-o">Copy</button></div></div><h2><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="osspawnprocesscommand-cwd"></a>os.spawnProcess(command, cwd)<a class="hash-link" href="#osspawnprocesscommand-cwd" title="Direct link to heading">#</a></h2><p>在后台基于一个命令生成进程，并让开发者控制它。</p><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="parameters-1"></a>Parameters<a class="hash-link" href="#parameters-1" title="Direct link to heading">#</a></h3><ul><li><code>command</code> String: 在新进程中执行的命令。</li><li><code>cwd</code> String (可选): 当前工作目录。</li></ul><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="return-object-awaited-1"></a>Return Object (awaited):<a class="hash-link" href="#return-object-awaited-1" title="Direct link to heading">#</a></h3><ul><li><code>id</code> Number: Neutralino专用的进程标识符。此值用于通过本地API控制进程。</li><li><code>pid</code> Number: 操作系统的进程标识符。</li></ul><div class="codeBlockContainer_K1bP"><div class="codeBlockContent_hGly js"><div tabindex="0" class="prism-code language-js codeBlock_23N8 thin-scrollbar"><div class="codeBlockLines_39YC" style="color:#bfc7d5;background-color:#292d3e"><div class="token-line" style="color:#bfc7d5"><span class="token keyword" style="font-style:italic">let</span><span class="token plain"> pingProc </span><span class="token operator" style="color:rgb(137, 221, 255)">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="font-style:italic">await</span><span class="token plain"> </span><span class="token maybe-class-name">Neutralino</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token property-access">os</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token method function property-access" style="color:rgb(130, 170, 255)">spawnProcess</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string" style="color:rgb(195, 232, 141)">&#x27;ping neutralino.js.org&#x27;</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><span class="token plain"></span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain" style="display:inline-block">
</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"></span><span class="token maybe-class-name">Neutralino</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token property-access">events</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token method function property-access" style="color:rgb(130, 170, 255)">on</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string" style="color:rgb(195, 232, 141)">&#x27;spawnedProcess&#x27;</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token parameter">evt</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"> </span><span class="token arrow operator" style="color:rgb(137, 221, 255)">=&gt;</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><span class="token plain"></span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">    </span><span class="token keyword control-flow" style="font-style:italic">if</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token plain">pingProc</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token property-access">id</span><span class="token plain"> </span><span class="token operator" style="color:rgb(137, 221, 255)">==</span><span class="token plain"> evt</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token property-access">detail</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token property-access">id</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><span class="token plain"></span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">        </span><span class="token keyword control-flow" style="font-style:italic">switch</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token plain">evt</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token property-access">detail</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token property-access">action</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><span class="token plain"></span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">            </span><span class="token keyword" style="font-style:italic">case</span><span class="token plain"> </span><span class="token string" style="color:rgb(195, 232, 141)">&#x27;stdOut&#x27;</span><span class="token operator" style="color:rgb(137, 221, 255)">:</span><span class="token plain"></span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">                </span><span class="token console class-name" style="color:rgb(255, 203, 107)">console</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token method function property-access" style="color:rgb(130, 170, 255)">log</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token plain">evt</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token property-access">detail</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token property-access">data</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><span class="token plain"></span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">                </span><span class="token keyword control-flow" style="font-style:italic">break</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><span class="token plain"></span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">            </span><span class="token keyword" style="font-style:italic">case</span><span class="token plain"> </span><span class="token string" style="color:rgb(195, 232, 141)">&#x27;stdErr&#x27;</span><span class="token operator" style="color:rgb(137, 221, 255)">:</span><span class="token plain"></span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">                </span><span class="token console class-name" style="color:rgb(255, 203, 107)">console</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token method function property-access" style="color:rgb(130, 170, 255)">error</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token plain">evt</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token property-access">detail</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token property-access">data</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><span class="token plain"></span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">                </span><span class="token keyword control-flow" style="font-style:italic">break</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><span class="token plain"></span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">            </span><span class="token keyword" style="font-style:italic">case</span><span class="token plain"> </span><span class="token string" style="color:rgb(195, 232, 141)">&#x27;exit&#x27;</span><span class="token operator" style="color:rgb(137, 221, 255)">:</span><span class="token plain"></span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">                </span><span class="token console class-name" style="color:rgb(255, 203, 107)">console</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token method function property-access" style="color:rgb(130, 170, 255)">log</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token template-string template-punctuation string" style="color:rgb(195, 232, 141)">`</span><span class="token template-string string" style="color:rgb(195, 232, 141)">Ping进程已终止，退出代码：</span><span class="token template-string interpolation interpolation-punctuation punctuation" style="color:rgb(199, 146, 234)">${</span><span class="token template-string interpolation">evt</span><span class="token template-string interpolation punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token template-string interpolation">detail</span><span class="token template-string interpolation punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token template-string interpolation">data</span><span class="token template-string interpolation interpolation-punctuation punctuation" style="color:rgb(199, 146, 234)">}</span><span class="token template-string template-punctuation string" style="color:rgb(195, 232, 141)">`</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><span class="token plain"></span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">                </span><span class="token keyword control-flow" style="font-style:italic">break</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><span class="token plain"></span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">        </span><span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><span class="token plain"></span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">    </span><span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><span class="token plain"></span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"></span><span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span></div></div></div><button type="button" aria-label="Copy code to clipboard" class="copyButton_Ue-o">Copy</button></div></div><h2><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="osupdatespawnedprocessid-action-data"></a>os.updateSpawnedProcess(id, action, data)<a class="hash-link" href="#osupdatespawnedprocessid-action-data" title="Direct link to heading">#</a></h2><p>根据提供的操作和数据更新生成的进程。如果无法更新进程，则抛出 <code>NE_OS_UNLTOUP</code>。</p><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="parameters-2"></a>Parameters<a class="hash-link" href="#parameters-2" title="Direct link to heading">#</a></h3><ul><li><code>id</code> Number: Neutralino专用的进程标识符。</li><li><code>action</code> String: 要执行的操作。仅接受以下值：<ul><li><code>stdIn</code>: 通过标准输入流向进程发送数据。</li><li><code>stdInEnd</code>: 关闭标准输入流文件描述符。</li><li><code>exit</code>: 终止进程。</li></ul></li><li><code>data</code> Object (可选): <code>action</code> 的额外数据。如果 <code>action</code> 是 <code>stdIn</code>，则发送标准输入字符串。</li></ul><div class="codeBlockContainer_K1bP"><div class="codeBlockContent_hGly js"><div tabindex="0" class="prism-code language-js codeBlock_23N8 thin-scrollbar"><div class="codeBlockLines_39YC" style="color:#bfc7d5;background-color:#292d3e"><div class="token-line" style="color:#bfc7d5"><span class="token keyword" style="font-style:italic">let</span><span class="token plain"> nodeProc </span><span class="token operator" style="color:rgb(137, 221, 255)">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="font-style:italic">await</span><span class="token plain"> </span><span class="token maybe-class-name">Neutralino</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token property-access">os</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token method function property-access" style="color:rgb(130, 170, 255)">spawnProcess</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string" style="color:rgb(195, 232, 141)">&#x27;node&#x27;</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><span class="token plain"></span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain" style="display:inline-block">
</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"></span><span class="token maybe-class-name">Neutralino</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token property-access">events</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token method function property-access" style="color:rgb(130, 170, 255)">on</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string" style="color:rgb(195, 232, 141)">&#x27;spawnedProcess&#x27;</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token parameter">evt</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"> </span><span class="token arrow operator" style="color:rgb(137, 221, 255)">=&gt;</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><span class="token plain"></span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">    </span><span class="token keyword control-flow" style="font-style:italic">if</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token plain">nodeProc</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token property-access">id</span><span class="token plain"> </span><span class="token operator" style="color:rgb(137, 221, 255)">==</span><span class="token plain"> evt</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token property-access">detail</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token property-access">id</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><span class="token plain"></span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">        </span><span class="token keyword control-flow" style="font-style:italic">switch</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token plain">evt</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token property-access">detail</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token property-access">action</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><span class="token plain"></span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">            </span><span class="token keyword" style="font-style:italic">case</span><span class="token plain"> </span><span class="token string" style="color:rgb(195, 232, 141)">&#x27;stdOut&#x27;</span><span class="token operator" style="color:rgb(137, 221, 255)">:</span><span class="token plain"></span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">                </span><span class="token console class-name" style="color:rgb(255, 203, 107)">console</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token method function property-access" style="color:rgb(130, 170, 255)">log</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token plain">evt</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token property-access">detail</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token property-access">data</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><span class="token plain"> </span><span class="token comment" style="color:rgb(105, 112, 152);font-style:italic">// 10</span><span class="token plain"></span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">                </span><span class="token keyword control-flow" style="font-style:italic">break</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><span class="token plain"></span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">            </span><span class="token keyword" style="font-style:italic">case</span><span class="token plain"> </span><span class="token string" style="color:rgb(195, 232, 141)">&#x27;stdErr&#x27;</span><span class="token operator" style="color:rgb(137, 221, 255)">:</span><span class="token plain"></span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">                </span><span class="token console class-name" style="color:rgb(255, 203, 107)">console</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token method function property-access" style="color:rgb(130, 170, 255)">error</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token plain">evt</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token property-access">detail</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token property-access">data</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><span class="token plain"></span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">                </span><span class="token keyword control-flow" style="font-style:italic">break</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><span class="token plain"></span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">            </span><span class="token keyword" style="font-style:italic">case</span><span class="token plain"> </span><span class="token string" style="color:rgb(195, 232, 141)">&#x27;exit&#x27;</span><span class="token operator" style="color:rgb(137, 221, 255)">:</span><span class="token plain"></span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">                </span><span class="token console class-name" style="color:rgb(255, 203, 107)">console</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token method function property-access" style="color:rgb(130, 170, 255)">log</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token template-string template-punctuation string" style="color:rgb(195, 232, 141)">`</span><span class="token template-string string" style="color:rgb(195, 232, 141)">Node.js进程已终止，退出代码：</span><span class="token template-string interpolation interpolation-punctuation punctuation" style="color:rgb(199, 146, 234)">${</span><span class="token template-string interpolation">evt</span><span class="token template-string interpolation punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token template-string interpolation">detail</span><span class="token template-string interpolation punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token template-string interpolation">data</span><span class="token template-string interpolation interpolation-punctuation punctuation" style="color:rgb(199, 146, 234)">}</span><span class="token template-string template-punctuation string" style="color:rgb(195, 232, 141)">`</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><span class="token plain"></span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">                </span><span class="token keyword control-flow" style="font-style:italic">break</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><span class="token plain"></span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">        </span><span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><span class="token plain"></span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">    </span><span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><span class="token plain"></span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"></span><span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><span class="token plain"></span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain" style="display:inline-block">
</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"></span><span class="token keyword control-flow" style="font-style:italic">await</span><span class="token plain"> </span><span class="token maybe-class-name">Neutralino</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token property-access">os</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token method function property-access" style="color:rgb(130, 170, 255)">updateSpawnedProcess</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token plain">nodeProc</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token property-access">id</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> </span><span class="token string" style="color:rgb(195, 232, 141)">&#x27;stdIn&#x27;</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> </span><span class="token string" style="color:rgb(195, 232, 141)">&#x27;console.log(5 + 5);&#x27;</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><span class="token plain"></span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"></span><span class="token keyword control-flow" style="font-style:italic">await</span><span class="token plain"> </span><span class="token maybe-class-name">Neutralino</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token property-access">os</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token method function property-access" style="color:rgb(130, 170, 255)">updateSpawnedProcess</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token plain">nodeProc</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token property-access">id</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> </span><span class="token string" style="color:rgb(195, 232, 141)">&#x27;stdInEnd&#x27;</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span></div></div></div><button type="button" aria-label="Copy code to clipboard" class="copyButton_Ue-o">Copy</button></div></div><h2><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="osgetspawnedprocesses"></a>os.getSpawnedProcesses()<a class="hash-link" href="#osgetspawnedprocesses" title="Direct link to heading">#</a></h2><p>返回所有生成的进程。</p><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="return-object-awaited-2"></a>Return Object (awaited):<a class="hash-link" href="#return-object-awaited-2" title="Direct link to heading">#</a></h3><p>一个<code>SpawnedProcess</code>对象的数组。</p><h4><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="spawnedprocess"></a>SpawnedProcess<a class="hash-link" href="#spawnedprocess" title="Direct link to heading">#</a></h4><ul><li><code>id</code> Number: Neutralino专用的进程标识符。</li><li><code>pid</code> Number: 操作系统的进程标识符。</li></ul><div class="codeBlockContainer_K1bP"><div class="codeBlockContent_hGly js"><div tabindex="0" class="prism-code language-js codeBlock_23N8 thin-scrollbar"><div class="codeBlockLines_39YC" style="color:#bfc7d5;background-color:#292d3e"><div class="token-line" style="color:#bfc7d5"><span class="token keyword control-flow" style="font-style:italic">await</span><span class="token plain"> </span><span class="token maybe-class-name">Neutralino</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token property-access">os</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token method function property-access" style="color:rgb(130, 170, 255)">spawnProcess</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string" style="color:rgb(195, 232, 141)">&#x27;ping neutralino.js.org&#x27;</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><span class="token plain"></span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"></span><span class="token keyword control-flow" style="font-style:italic">await</span><span class="token plain"> </span><span class="token maybe-class-name">Neutralino</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token property-access">os</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token method function property-access" style="color:rgb(130, 170, 255)">spawnProcess</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string" style="color:rgb(195, 232, 141)">&#x27;ping codezri.org&#x27;</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><span class="token plain"></span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain" style="display:inline-block">
</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"></span><span class="token keyword" style="font-style:italic">let</span><span class="token plain"> processes </span><span class="token operator" style="color:rgb(137, 221, 255)">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="font-style:italic">await</span><span class="token plain"> </span><span class="token maybe-class-name">Neutralino</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token property-access">os</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token method function property-access" style="color:rgb(130, 170, 255)">getSpawnedProcesses</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><span class="token plain"></span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"></span><span class="token console class-name" style="color:rgb(255, 203, 107)">console</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token method function property-access" style="color:rgb(130, 170, 255)">log</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token plain">processes</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span></div></div></div><button type="button" aria-label="Copy code to clipboard" class="copyButton_Ue-o">Copy</button></div></div><h2><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="osgetenvkey"></a>os.getEnv(key)<a class="hash-link" href="#osgetenvkey" title="Direct link to heading">#</a></h2><p>提供给定环境变量的值。</p><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="parameters-3"></a>Parameters<a class="hash-link" href="#parameters-3" title="Direct link to heading">#</a></h3><ul><li><code>key</code> String: 环境变量的名称。</li></ul><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="return-string-awaited"></a>Return String (awaited):<a class="hash-link" href="#return-string-awaited" title="Direct link to heading">#</a></h3><p>给定环境变量的值。如果环境变量未定义，则返回空字符串。</p><div class="codeBlockContainer_K1bP"><div class="codeBlockContent_hGly js"><div tabindex="0" class="prism-code language-js codeBlock_23N8 thin-scrollbar"><div class="codeBlockLines_39YC" style="color:#bfc7d5;background-color:#292d3e"><div class="token-line" style="color:#bfc7d5"><span class="token keyword" style="font-style:italic">let</span><span class="token plain"> value </span><span class="token operator" style="color:rgb(137, 221, 255)">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="font-style:italic">await</span><span class="token plain"> </span><span class="token maybe-class-name">Neutralino</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token property-access">os</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token method function property-access" style="color:rgb(130, 170, 255)">getEnv</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string" style="color:rgb(195, 232, 141)">&#x27;USER&#x27;</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><span class="token plain"></span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"></span><span class="token console class-name" style="color:rgb(255, 203, 107)">console</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token method function property-access" style="color:rgb(130, 170, 255)">log</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token template-string template-punctuation string" style="color:rgb(195, 232, 141)">`</span><span class="token template-string string" style="color:rgb(195, 232, 141)">USER = </span><span class="token template-string interpolation interpolation-punctuation punctuation" style="color:rgb(199, 146, 234)">${</span><span class="token template-string interpolation">value</span><span class="token template-string interpolation interpolation-punctuation punctuation" style="color:rgb(199, 146, 234)">}</span><span class="token template-string template-punctuation string" style="color:rgb(195, 232, 141)">`</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span></div></div></div><button type="button" aria-label="Copy code to clipboard" class="copyButton_Ue-o">Copy</button></div></div><h2><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="osgetenvs"></a>os.getEnvs()<a class="hash-link" href="#osgetenvs" title="Direct link to heading">#</a></h2><p>返回所有环境变量及其值。</p><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="return-object-awaited-3"></a>Return Object (awaited):<a class="hash-link" href="#return-object-awaited-3" title="Direct link to heading">#</a></h3><p>以键值对形式的环境变量详情。</p><div class="codeBlockContainer_K1bP"><div class="codeBlockContent_hGly js"><div tabindex="0" class="prism-code language-js codeBlock_23N8 thin-scrollbar"><div class="codeBlockLines_39YC" style="color:#bfc7d5;background-color:#292d3e"><div class="token-line" style="color:#bfc7d5"><span class="token keyword" style="font-style:italic">let</span><span class="token plain"> envs </span><span class="token operator" style="color:rgb(137, 221, 255)">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="font-style:italic">await</span><span class="token plain"> </span><span class="token maybe-class-name">Neutralino</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token property-access">os</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token method function property-access" style="color:rgb(130, 170, 255)">getEnvs</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><span class="token plain"></span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"></span><span class="token console class-name" style="color:rgb(255, 203, 107)">console</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token method function property-access" style="color:rgb(130, 170, 255)">log</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token plain">envs</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span></div></div></div><button type="button" aria-label="Copy code to clipboard" class="copyButton_Ue-o">Copy</button></div></div><h2><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="osshowopendialogtitle-options"></a>os.showOpenDialog(title, options)<a class="hash-link" href="#osshowopendialogtitle-options" title="Direct link to heading">#</a></h2><p>显示文件打开对话框。你可以使用这个函数来获取现有文件的路径。</p><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="parameters-4"></a>Parameters<a class="hash-link" href="#parameters-4" title="Direct link to heading">#</a></h3><ul><li><code>title</code> String (可选): 对话框的标题。</li></ul><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="options-1"></a>Options<a class="hash-link" href="#options-1" title="Direct link to heading">#</a></h3><ul><li><code>filters</code> Filter[] (可选): 一个Filter对象数组，用于过滤文件列表。</li><li><code>multiSelections</code> (可选): 启用多选。</li><li><code>defaultPath</code> String (可选): 对话框显示的初始路径/文件名。</li></ul><h4><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="filter"></a>Filter<a class="hash-link" href="#filter" title="Direct link to heading">#</a></h4><ul><li><code>name</code> String: 过滤器名称。</li><li><code>extensions</code> String: 文件扩展名数组。例如：<code>[&#x27;jpg&#x27;, &#x27;png&#x27;]</code></li></ul><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="return-object-awaited-4"></a>Return Object (awaited):<a class="hash-link" href="#return-object-awaited-4" title="Direct link to heading">#</a></h3><p>选中的条目数组。</p><div class="codeBlockContainer_K1bP"><div class="codeBlockContent_hGly js"><div tabindex="0" class="prism-code language-js codeBlock_23N8 thin-scrollbar"><div class="codeBlockLines_39YC" style="color:#bfc7d5;background-color:#292d3e"><div class="token-line" style="color:#bfc7d5"><span class="token keyword" style="font-style:italic">let</span><span class="token plain"> entries </span><span class="token operator" style="color:rgb(137, 221, 255)">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="font-style:italic">await</span><span class="token plain"> </span><span class="token maybe-class-name">Neutralino</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token property-access">os</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token method function property-access" style="color:rgb(130, 170, 255)">showOpenDialog</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string" style="color:rgb(195, 232, 141)">&#x27;打开图表&#x27;</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><span class="token plain"></span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">  defaultPath</span><span class="token operator" style="color:rgb(137, 221, 255)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(195, 232, 141)">&#x27;/home/my/directory/&#x27;</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"></span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">  filters</span><span class="token operator" style="color:rgb(137, 221, 255)">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(199, 146, 234)">[</span><span class="token plain"></span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">    </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><span class="token plain">name</span><span class="token operator" style="color:rgb(137, 221, 255)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(195, 232, 141)">&#x27;图片&#x27;</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> extensions</span><span class="token operator" style="color:rgb(137, 221, 255)">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(199, 146, 234)">[</span><span class="token string" style="color:rgb(195, 232, 141)">&#x27;jpg&#x27;</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> </span><span class="token string" style="color:rgb(195, 232, 141)">&#x27;png&#x27;</span><span class="token punctuation" style="color:rgb(199, 146, 234)">]</span><span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"></span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">    </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><span class="token plain">name</span><span class="token operator" style="color:rgb(137, 221, 255)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(195, 232, 141)">&#x27;所有文件&#x27;</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> extensions</span><span class="token operator" style="color:rgb(137, 221, 255)">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(199, 146, 234)">[</span><span class="token string" style="color:rgb(195, 232, 141)">&#x27;*&#x27;</span><span class="token punctuation" style="color:rgb(199, 146, 234)">]</span><span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><span class="token plain"></span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">  </span><span class="token punctuation" style="color:rgb(199, 146, 234)">]</span><span class="token plain"></span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"></span><span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><span class="token plain"></span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"></span><span class="token console class-name" style="color:rgb(255, 203, 107)">console</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token method function property-access" style="color:rgb(130, 170, 255)">log</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string" style="color:rgb(195, 232, 141)">&#x27;您已选择:&#x27;</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> entries</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span></div></div></div><button type="button" aria-label="Copy code to clipboard" class="copyButton_Ue-o">Copy</button></div></div><h2><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="osshowsavedialogtitle-options"></a>os.showSaveDialog(title, options)<a class="hash-link" href="#osshowsavedialogtitle-options" title="Direct link to heading">#</a></h2><p>显示文件保存对话框。您可以使用这个函数来获取创建新文件的路径。</p><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="parameters-5"></a>Parameters<a class="hash-link" href="#parameters-5" title="Direct link to heading">#</a></h3><ul><li><code>title</code> String (可选): 对话框的标题。</li></ul><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="options-2"></a>Options<a class="hash-link" href="#options-2" title="Direct link to heading">#</a></h3><ul><li><code>filters</code> Filter[] (可选): 一个Filter对象数组，用于过滤文件列表。</li><li><code>forceOverwrite</code> Boolean (可选): 跳过文件覆盖警告消息。</li><li><code>defaultPath</code> String (可选): 对话框显示的初始路径/文件名。</li></ul><h4><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="filter-1"></a>Filter<a class="hash-link" href="#filter-1" title="Direct link to heading">#</a></h4><ul><li><code>name</code> String: 过滤器名称。</li><li><code>extensions</code> String[]: 文件扩展名数组。例如：<code>[&#x27;jpg&#x27;, &#x27;png&#x27;]</code></li></ul><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="return-string-awaited-1"></a>Return String (awaited):<a class="hash-link" href="#return-string-awaited-1" title="Direct link to heading">#</a></h3><p>选中的文件名。</p><div class="codeBlockContainer_K1bP"><div class="codeBlockContent_hGly js"><div tabindex="0" class="prism-code language-js codeBlock_23N8 thin-scrollbar"><div class="codeBlockLines_39YC" style="color:#bfc7d5;background-color:#292d3e"><div class="token-line" style="color:#bfc7d5"><span class="token keyword" style="font-style:italic">let</span><span class="token plain"> entry </span><span class="token operator" style="color:rgb(137, 221, 255)">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="font-style:italic">await</span><span class="token plain"> </span><span class="token maybe-class-name">Neutralino</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token property-access">os</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token method function property-access" style="color:rgb(130, 170, 255)">showSaveDialog</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string" style="color:rgb(195, 232, 141)">&#x27;保存文件&#x27;</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><span class="token plain"></span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">  defaultPath</span><span class="token operator" style="color:rgb(137, 221, 255)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(195, 232, 141)">&#x27;untitled.jpg&#x27;</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"></span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">  filters</span><span class="token operator" style="color:rgb(137, 221, 255)">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(199, 146, 234)">[</span><span class="token plain"></span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">    </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><span class="token plain">name</span><span class="token operator" style="color:rgb(137, 221, 255)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(195, 232, 141)">&#x27;图片&#x27;</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> extensions</span><span class="token operator" style="color:rgb(137, 221, 255)">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(199, 146, 234)">[</span><span class="token string" style="color:rgb(195, 232, 141)">&#x27;jpg&#x27;</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> </span><span class="token string" style="color:rgb(195, 232, 141)">&#x27;png&#x27;</span><span class="token punctuation" style="color:rgb(199, 146, 234)">]</span><span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"></span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">    </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><span class="token plain">name</span><span class="token operator" style="color:rgb(137, 221, 255)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(195, 232, 141)">&#x27;所有文件&#x27;</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> extensions</span><span class="token operator" style="color:rgb(137, 221, 255)">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(199, 146, 234)">[</span><span class="token string" style="color:rgb(195, 232, 141)">&#x27;*&#x27;</span><span class="token punctuation" style="color:rgb(199, 146, 234)">]</span><span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><span class="token plain"></span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">  </span><span class="token punctuation" style="color:rgb(199, 146, 234)">]</span><span class="token plain"></span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"></span><span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><span class="token plain"></span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"></span><span class="token console class-name" style="color:rgb(255, 203, 107)">console</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token method function property-access" style="color:rgb(130, 170, 255)">log</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string" style="color:rgb(195, 232, 141)">&#x27;您已选择:&#x27;</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> entry</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span></div></div></div><button type="button" aria-label="Copy code to clipboard" class="copyButton_Ue-o">Copy</button></div></div><h2><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="osshowfolderdialogtitle"></a>os.showFolderDialog(title)<a class="hash-link" href="#osshowfolderdialogtitle" title="Direct link to heading">#</a></h2><p>显示文件夹打开对话框。</p><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="parameters-6"></a>Parameters<a class="hash-link" href="#parameters-6" title="Direct link to heading">#</a></h3><ul><li><code>title</code> String (可选): 对话框的标题。</li></ul><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="options-3"></a>Options<a class="hash-link" href="#options-3" title="Direct link to heading">#</a></h3><ul><li><code>defaultPath</code> String (可选): 对话框显示的初始路径。</li></ul><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="return-string-awaited-2"></a>Return String (awaited):<a class="hash-link" href="#return-string-awaited-2" title="Direct link to heading">#</a></h3><p>选中的文件夹。</p><div class="codeBlockContainer_K1bP"><div class="codeBlockContent_hGly js"><div tabindex="0" class="prism-code language-js codeBlock_23N8 thin-scrollbar"><div class="codeBlockLines_39YC" style="color:#bfc7d5;background-color:#292d3e"><div class="token-line" style="color:#bfc7d5"><span class="token keyword" style="font-style:italic">let</span><span class="token plain"> entry </span><span class="token operator" style="color:rgb(137, 221, 255)">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="font-style:italic">await</span><span class="token plain"> </span><span class="token maybe-class-name">Neutralino</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token property-access">os</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token method function property-access" style="color:rgb(130, 170, 255)">showFolderDialog</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string" style="color:rgb(195, 232, 141)">&#x27;选择安装目录&#x27;</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><span class="token plain"></span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">  defaultPath</span><span class="token operator" style="color:rgb(137, 221, 255)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(195, 232, 141)">&#x27;/home/my/directory/&#x27;</span><span class="token plain"></span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"></span><span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><span class="token plain"></span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"></span><span class="token console class-name" style="color:rgb(255, 203, 107)">console</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token method function property-access" style="color:rgb(130, 170, 255)">log</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string" style="color:rgb(195, 232, 141)">&#x27;您已选择:&#x27;</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> entry</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span></div></div></div><button type="button" aria-label="Copy code to clipboard" class="copyButton_Ue-o">Copy</button></div></div><h2><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="osshownotificationtitle-content-icon"></a>os.showNotification(title, content, icon)<a class="hash-link" href="#osshownotificationtitle-content-icon" title="Direct link to heading">#</a></h2><p>显示一个通知消息。</p><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="parameters-7"></a>Parameters<a class="hash-link" href="#parameters-7" title="Direct link to heading">#</a></h3><ul><li><code>title</code> String: 通知标题。</li><li><code>content</code> String: 通知内容。</li><li><code>icon</code> String (可选): 图标名称。接受的值有：<code>INFO</code>, <code>WARNING</code>, <code>ERROR</code> 和 <code>QUESTION</code>。默认值为 <code>INFO</code>。</li></ul><div class="codeBlockContainer_K1bP"><div class="codeBlockContent_hGly js"><div tabindex="0" class="prism-code language-js codeBlock_23N8 thin-scrollbar"><div class="codeBlockLines_39YC" style="color:#bfc7d5;background-color:#292d3e"><div class="token-line" style="color:#bfc7d5"><span class="token keyword control-flow" style="font-style:italic">await</span><span class="token plain"> </span><span class="token maybe-class-name">Neutralino</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token property-access">os</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token method function property-access" style="color:rgb(130, 170, 255)">showNotification</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string" style="color:rgb(195, 232, 141)">&#x27;你好世界&#x27;</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> </span><span class="token string" style="color:rgb(195, 232, 141)">&#x27;它运行正常！祝你有美好的一天&#x27;</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><span class="token plain"></span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain" style="display:inline-block">
</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"></span><span class="token keyword control-flow" style="font-style:italic">await</span><span class="token plain"> </span><span class="token maybe-class-name">Neutralino</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token property-access">os</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token method function property-access" style="color:rgb(130, 170, 255)">showNotification</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string" style="color:rgb(195, 232, 141)">&#x27;哎呀 :/&#x27;</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> </span><span class="token string" style="color:rgb(195, 232, 141)">&#x27;出了些问题&#x27;</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> </span><span class="token string" style="color:rgb(195, 232, 141)">&#x27;ERROR&#x27;</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span></div></div></div><button type="button" aria-label="Copy code to clipboard" class="copyButton_Ue-o">Copy</button></div></div><h2><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="osshowmessageboxtitle-content-choice-icon"></a>os.showMessageBox(title, content, choice, icon)<a class="hash-link" href="#osshowmessageboxtitle-content-choice-icon" title="Direct link to heading">#</a></h2><p>显示一个消息框。</p><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="parameters-8"></a>Parameters<a class="hash-link" href="#parameters-8" title="Direct link to heading">#</a></h3><ul><li><code>title</code> String: 消息框的标题。</li><li><code>content</code> String: 消息框的内容。</li><li><code>choice</code> String (可选): 消息框按钮。接受的值有：<code>OK</code>, <code>OK_CANCEL</code>, <code>YES_NO</code>, <code>YES_NO_CANCEL</code>, <code>RETRY_CANCEL</code>, 和 <code>ABORT_RETRY_IGNORE</code>。默认值为 <code>OK</code>。</li><li><code>icon</code> String (可选): 图标名称。接受的值有：<code>INFO</code>, <code>WARNING</code>, <code>ERROR</code>, 和 <code>QUESTION</code>。默认值为 <code>INFO</code>。</li></ul><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="return-string-awaited-3"></a>Return String (awaited):<a class="hash-link" href="#return-string-awaited-3" title="Direct link to heading">#</a></h3><p>用户的 <code>choice</code>。</p><div class="codeBlockContainer_K1bP"><div class="codeBlockContent_hGly js"><div tabindex="0" class="prism-code language-js codeBlock_23N8 thin-scrollbar"><div class="codeBlockLines_39YC" style="color:#bfc7d5;background-color:#292d3e"><div class="token-line" style="color:#bfc7d5"><span class="token keyword control-flow" style="font-style:italic">await</span><span class="token plain"> </span><span class="token maybe-class-name">Neutralino</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token property-access">os</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token method function property-access" style="color:rgb(130, 170, 255)">showMessageBox</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string" style="color:rgb(195, 232, 141)">&#x27;你好&#x27;</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> </span><span class="token string" style="color:rgb(195, 232, 141)">&#x27;欢迎&#x27;</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><span class="token plain"></span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain" style="display:inline-block">
</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"></span><span class="token keyword" style="font-style:italic">let</span><span class="token plain"> button </span><span class="token operator" style="color:rgb(137, 221, 255)">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="font-style:italic">await</span><span class="token plain"> </span><span class="token maybe-class-name">Neutralino</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token property-access">os</span><span class="token plain"></span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">            </span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token method function property-access" style="color:rgb(130, 170, 255)">showMessageBox</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string" style="color:rgb(195, 232, 141)">&#x27;确认&#x27;</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"></span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">                            </span><span class="token string" style="color:rgb(195, 232, 141)">&#x27;你确定你要退出吗？&#x27;</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"></span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">                            </span><span class="token string" style="color:rgb(195, 232, 141)">&#x27;YES_NO&#x27;</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> </span><span class="token string" style="color:rgb(195, 232, 141)">&#x27;QUESTION&#x27;</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><span class="token plain"></span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"></span><span class="token keyword control-flow" style="font-style:italic">if</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token plain">button </span><span class="token operator" style="color:rgb(137, 221, 255)">==</span><span class="token plain"> </span><span class="token string" style="color:rgb(195, 232, 141)">&#x27;YES&#x27;</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><span class="token plain"></span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">    </span><span class="token maybe-class-name">Neutralino</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token property-access">app</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token method function property-access" style="color:rgb(130, 170, 255)">exit</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><span class="token plain"></span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"></span><span class="token punctuation" style="color:rgb(199, 146, 234)">}</span></div></div></div><button type="button" aria-label="Copy code to clipboard" class="copyButton_Ue-o">Copy</button></div></div><h2><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="ossettrayoptions"></a>os.setTray(options)<a class="hash-link" href="#ossettrayoptions" title="Direct link to heading">#</a></h2><p>创建/更新托盘图标和菜单。</p><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="options-4"></a>Options<a class="hash-link" href="#options-4" title="Direct link to heading">#</a></h3><ul><li><code>icon</code> String: 托盘图标路径。例如：<code>/resources/icons/trayIcon.png</code>。一个 <code>20x20</code> 尺寸的PNG图像文件在所有支持的操作系统上都能很好工作。</li><li><code>menuItems</code> TrayMenuItem[]: <code>TrayMenuItem</code> 对象数组。</li></ul><h4><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="traymenuitem"></a>TrayMenuItem<a class="hash-link" href="#traymenuitem" title="Direct link to heading">#</a></h4><ul><li><code>id</code> String (可选): 每个菜单项的唯一标识符。</li><li><code>text</code> String: 菜单项的标签。这是一个必填字段。使用 <code>-</code>（连字符）字符表示菜单分隔符。</li><li><code>isDisabled</code> Boolean (可选): 一个布尔标志，用于禁用/启用特定菜单项。</li><li><code>isChecked</code> Boolean (可选): 一个布尔标志，用于标记特定菜单项为选中状态。</li></ul><div class="codeBlockContainer_K1bP"><div class="codeBlockContent_hGly js"><div tabindex="0" class="prism-code language-js codeBlock_23N8 thin-scrollbar"><div class="codeBlockLines_39YC" style="color:#bfc7d5;background-color:#292d3e"><div class="token-line" style="color:#bfc7d5"><span class="token keyword" style="font-style:italic">let</span><span class="token plain"> tray </span><span class="token operator" style="color:rgb(137, 221, 255)">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><span class="token plain"></span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">  icon</span><span class="token operator" style="color:rgb(137, 221, 255)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(195, 232, 141)">&#x27;/resources/icons/trayIcon.png&#x27;</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"></span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">  menuItems</span><span class="token operator" style="color:rgb(137, 221, 255)">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(199, 146, 234)">[</span><span class="token plain"></span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">    </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><span class="token plain">id</span><span class="token operator" style="color:rgb(137, 221, 255)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(195, 232, 141)">&quot;about&quot;</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> text</span><span class="token operator" style="color:rgb(137, 221, 255)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(195, 232, 141)">&quot;关于&quot;</span><span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"></span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">    </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><span class="token plain">text</span><span class="token operator" style="color:rgb(137, 221, 255)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(195, 232, 141)">&quot;-&quot;</span><span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"></span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">    </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><span class="token plain">id</span><span class="token operator" style="color:rgb(137, 221, 255)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(195, 232, 141)">&quot;quit&quot;</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> text</span><span class="token operator" style="color:rgb(137, 221, 255)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(195, 232, 141)">&quot;退出&quot;</span><span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><span class="token plain"></span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">  </span><span class="token punctuation" style="color:rgb(199, 146, 234)">]</span><span class="token plain"></span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"></span><span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><span class="token plain"></span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain" style="display:inline-block">
</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"></span><span class="token keyword control-flow" style="font-style:italic">await</span><span class="token plain"> </span><span class="token maybe-class-name">Neutralino</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token property-access">os</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token method function property-access" style="color:rgb(130, 170, 255)">setTray</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token plain">tray</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span></div></div></div><button type="button" aria-label="Copy code to clipboard" class="copyButton_Ue-o">Copy</button></div></div><h2><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="osgetpathname"></a>os.getPath(name)<a class="hash-link" href="#osgetpathname" title="Direct link to heading">#</a></h2><p>返回已知的平台特定文件夹，如下载、音乐、视频等。</p><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="parameters-9"></a>Parameters<a class="hash-link" href="#parameters-9" title="Direct link to heading">#</a></h3><ul><li><code>title</code> String: 文件夹的名称。接受的值有：<code>config</code>, <code>data</code>, <code>cache</code>, <code>documents</code>, <code>pictures</code>, <code>music</code>, <code>video</code>, <code>downloads</code>, <code>savedGames1</code>, 和 <code>savedGames2</code>。对无效的文件夹名抛出 <code>NE_OS_INVKNPT</code>。</li></ul><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="return-string-awaited-4"></a>Return String (awaited):<a class="hash-link" href="#return-string-awaited-4" title="Direct link to heading">#</a></h3><p>路径。</p><div class="codeBlockContainer_K1bP"><div class="codeBlockContent_hGly js"><div tabindex="0" class="prism-code language-js codeBlock_23N8 thin-scrollbar"><div class="codeBlockLines_39YC" style="color:#bfc7d5;background-color:#292d3e"><div class="token-line" style="color:#bfc7d5"><span class="token keyword" style="font-style:italic">let</span><span class="token plain"> downloadsPath </span><span class="token operator" style="color:rgb(137, 221, 255)">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="font-style:italic">await</span><span class="token plain"> </span><span class="token maybe-class-name">Neutralino</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token property-access">os</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token method function property-access" style="color:rgb(130, 170, 255)">getPath</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string" style="color:rgb(195, 232, 141)">&#x27;downloads&#x27;</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><span class="token plain"></span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"></span><span class="token console class-name" style="color:rgb(255, 203, 107)">console</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token method function property-access" style="color:rgb(130, 170, 255)">log</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token template-string template-punctuation string" style="color:rgb(195, 232, 141)">`</span><span class="token template-string string" style="color:rgb(195, 232, 141)">下载文件夹：</span><span class="token template-string interpolation interpolation-punctuation punctuation" style="color:rgb(199, 146, 234)">${</span><span class="token template-string interpolation">downloadsPath</span><span class="token template-string interpolation interpolation-punctuation punctuation" style="color:rgb(199, 146, 234)">}</span><span class="token template-string template-punctuation string" style="color:rgb(195, 232, 141)">`</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span></div></div></div><button type="button" aria-label="Copy code to clipboard" class="copyButton_Ue-o">Copy</button></div></div><h2><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="osopenurl"></a>os.open(url)<a class="hash-link" href="#osopenurl" title="Direct link to heading">#</a></h2><p>用默认的网页浏览器打开一个URL。</p><div class="admonition admonition-tip alert alert--success"><div class="admonition-heading"><h5><span class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" width="12" height="16" viewBox="0 0 12 16"><path fill-rule="evenodd" d="M6.5 0C3.48 0 1 2.19 1 5c0 .92.55 2.25 1 3 1.34 2.25 1.78 2.78 2 4v1h5v-1c.22-1.22.66-1.75 2-4 .45-.75 1-2.08 1-3 0-2.81-2.48-5-5.5-5zm3.64 7.48c-.25.44-.47.8-.67 1.11-.86 1.41-1.25 2.06-1.45 3.23-.02.05-.02.11-.02.17H5c0-.06 0-.13-.02-.17-.2-1.17-.59-1.83-1.45-3.23-.2-.31-.42-.67-.67-1.11C2.44 6.78 2 5.65 2 5c0-2.2 2.02-4 4.5-4 1.22 0 2.36.42 3.22 1.19C10.55 2.94 11 3.94 11 5c0 .66-.44 1.78-.86 2.48zM4 14h5c-.23 1.14-1.3 2-2.5 2s-2.27-.86-2.5-2z"></path></svg></span>tip</h5></div><div class="admonition-content"><p>如果你的应用正在默认的网页浏览器中运行，这个方法将打开一个新标签页。</p></div></div><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="parameters-10"></a>Parameters<a class="hash-link" href="#parameters-10" title="Direct link to heading">#</a></h3><ul><li><code>url</code> String: 要打开的URL。</li></ul><div class="codeBlockContainer_K1bP"><div class="codeBlockContent_hGly js"><div tabindex="0" class="prism-code language-js codeBlock_23N8 thin-scrollbar"><div class="codeBlockLines_39YC" style="color:#bfc7d5;background-color:#292d3e"><div class="token-line" style="color:#bfc7d5"><span class="token maybe-class-name">Neutralino</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token property-access">os</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token method function property-access" style="color:rgb(130, 170, 255)">open</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string" style="color:rgb(195, 232, 141)">&#x27;https://neutralino.js.org&#x27;</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span></div></div></div><button type="button" aria-label="Copy code to clipboard" class="copyButton_Ue-o">Copy</button></div></div></div></article><div class="margin-vert--xl"><div class="row"><div class="col"><a href="https://github.com/neutralinojs/neutralinojs.github.io/edit/main/docs/api/os.md" target="_blank" rel="noreferrer noopener"><svg fill="currentColor" height="1.2em" width="1.2em" preserveAspectRatio="xMidYMid meet" role="img" viewBox="0 0 40 40" class="iconEdit_2_ui" aria-label="Edit page"><g><path d="m34.5 11.7l-3 3.1-6.3-6.3 3.1-3q0.5-0.5 1.2-0.5t1.1 0.5l3.9 3.9q0.5 0.4 0.5 1.1t-0.5 1.2z m-29.5 17.1l18.4-18.5 6.3 6.3-18.4 18.4h-6.3v-6.2z"></path></g></svg>Edit this page</a></div></div></div><div class="margin-vert--lg"><nav class="pagination-nav" aria-label="Docs pages navigation"><div class="pagination-nav__item"><a class="pagination-nav__link" href="/zh-cn.neutralinojs.github.io/docs/api/init"><div class="pagination-nav__sublabel">Previous</div><div class="pagination-nav__label">« Neutralino.init</div></a></div><div class="pagination-nav__item pagination-nav__item--next"><a class="pagination-nav__link" href="/zh-cn.neutralinojs.github.io/docs/api/storage"><div class="pagination-nav__sublabel">Next</div><div class="pagination-nav__label">Neutralino.storage »</div></a></div></nav></div></div></div><div class="col col--3"><div class="tableOfContents_1nbE thin-scrollbar"><div><div data-ea-publisher="neutralino" data-ea-type="image" id="neutralino-docs"></div></div><ul class="table-of-contents table-of-contents__left-border"><li><a href="#osexeccommandcommand-options" class="table-of-contents__link">os.execCommand(command, options)</a><ul><li><a href="#parameters" class="table-of-contents__link">Parameters</a></li><li><a href="#options" class="table-of-contents__link">Options</a></li><li><a href="#return-object-awaited" class="table-of-contents__link">Return Object (awaited):</a></li></ul></li><li><a href="#osspawnprocesscommand-cwd" class="table-of-contents__link">os.spawnProcess(command, cwd)</a><ul><li><a href="#parameters-1" class="table-of-contents__link">Parameters</a></li><li><a href="#return-object-awaited-1" class="table-of-contents__link">Return Object (awaited):</a></li></ul></li><li><a href="#osupdatespawnedprocessid-action-data" class="table-of-contents__link">os.updateSpawnedProcess(id, action, data)</a><ul><li><a href="#parameters-2" class="table-of-contents__link">Parameters</a></li></ul></li><li><a href="#osgetspawnedprocesses" class="table-of-contents__link">os.getSpawnedProcesses()</a><ul><li><a href="#return-object-awaited-2" class="table-of-contents__link">Return Object (awaited):</a></li></ul></li><li><a href="#osgetenvkey" class="table-of-contents__link">os.getEnv(key)</a><ul><li><a href="#parameters-3" class="table-of-contents__link">Parameters</a></li><li><a href="#return-string-awaited" class="table-of-contents__link">Return String (awaited):</a></li></ul></li><li><a href="#osgetenvs" class="table-of-contents__link">os.getEnvs()</a><ul><li><a href="#return-object-awaited-3" class="table-of-contents__link">Return Object (awaited):</a></li></ul></li><li><a href="#osshowopendialogtitle-options" class="table-of-contents__link">os.showOpenDialog(title, options)</a><ul><li><a href="#parameters-4" class="table-of-contents__link">Parameters</a></li><li><a href="#options-1" class="table-of-contents__link">Options</a></li><li><a href="#return-object-awaited-4" class="table-of-contents__link">Return Object (awaited):</a></li></ul></li><li><a href="#osshowsavedialogtitle-options" class="table-of-contents__link">os.showSaveDialog(title, options)</a><ul><li><a href="#parameters-5" class="table-of-contents__link">Parameters</a></li><li><a href="#options-2" class="table-of-contents__link">Options</a></li><li><a href="#return-string-awaited-1" class="table-of-contents__link">Return String (awaited):</a></li></ul></li><li><a href="#osshowfolderdialogtitle" class="table-of-contents__link">os.showFolderDialog(title)</a><ul><li><a href="#parameters-6" class="table-of-contents__link">Parameters</a></li><li><a href="#options-3" class="table-of-contents__link">Options</a></li><li><a href="#return-string-awaited-2" class="table-of-contents__link">Return String (awaited):</a></li></ul></li><li><a href="#osshownotificationtitle-content-icon" class="table-of-contents__link">os.showNotification(title, content, icon)</a><ul><li><a href="#parameters-7" class="table-of-contents__link">Parameters</a></li></ul></li><li><a href="#osshowmessageboxtitle-content-choice-icon" class="table-of-contents__link">os.showMessageBox(title, content, choice, icon)</a><ul><li><a href="#parameters-8" class="table-of-contents__link">Parameters</a></li><li><a href="#return-string-awaited-3" class="table-of-contents__link">Return String (awaited):</a></li></ul></li><li><a href="#ossettrayoptions" class="table-of-contents__link">os.setTray(options)</a><ul><li><a href="#options-4" class="table-of-contents__link">Options</a></li></ul></li><li><a href="#osgetpathname" class="table-of-contents__link">os.getPath(name)</a><ul><li><a href="#parameters-9" class="table-of-contents__link">Parameters</a></li><li><a href="#return-string-awaited-4" class="table-of-contents__link">Return String (awaited):</a></li></ul></li><li><a href="#osopenurl" class="table-of-contents__link">os.open(url)</a><ul><li><a href="#parameters-10" class="table-of-contents__link">Parameters</a></li></ul></li></ul></div></div></div></div></main></div></div><footer class="footer footer--dark"><div class="container"><div class="row footer__links"><div class="col footer__col"><h4 class="footer__title">文档</h4><ul class="footer__items"><li class="footer__item"><a class="footer__link-item" href="/zh-cn.neutralinojs.github.io/docs/">入门</a></li><li class="footer__item"><a class="footer__link-item" href="/zh-cn.neutralinojs.github.io/docs/api/overview">API参考</a></li><li class="footer__item"><a class="footer__link-item" href="/zh-cn.neutralinojs.github.io/docs/cli/neu-cli">CLI</a></li><li class="footer__item"><a class="footer__link-item" href="/zh-cn.neutralinojs.github.io/docs/configuration/modes">模式</a></li><li class="footer__item"><a class="footer__link-item" href="/zh-cn.neutralinojs.github.io/docs/contributing/framework-developer-guide">贡献</a></li></ul></div><div class="col footer__col"><h4 class="footer__title">社区</h4><ul class="footer__items"><li class="footer__item"><a href="https://github.com/neutralinojs" target="_blank" rel="noopener noreferrer" class="footer__link-item">GitHub</a></li><li class="footer__item"><a href="https://twitter.com/neutralinojs" target="_blank" rel="noopener noreferrer" class="footer__link-item">Twitter</a></li><li class="footer__item"><a href="https://stackoverflow.com/questions/tagged/neutralinojs" target="_blank" rel="noopener noreferrer" class="footer__link-item">Stack Overflow</a></li><li class="footer__item"><a href="https://medium.com/neutralinojs" target="_blank" rel="noopener noreferrer" class="footer__link-item">Medium</a></li><li class="footer__item"><a href="https://www.youtube.com/watch?v=txDlNNsgSh8&amp;list=PLvTbqpiPhQRb2xNQlwMs0uVV0IN8N-pKj&amp;ab_channel=CodeZri" target="_blank" rel="noopener noreferrer" class="footer__link-item">YouTube</a></li><li class="footer__item"><a href="https://join.slack.com/t/neutralinojs/shared_invite/zt-b7mbivj5-pKpO6U5drmeT68vKD_pc6w" target="_blank" rel="noopener noreferrer" class="footer__link-item">Slack</a></li><li class="footer__item"><a href="https://discord.gg/cybpp4guTJ" target="_blank" rel="noopener noreferrer" class="footer__link-item">Discord</a></li><li class="footer__item"><a href="https://www.reddit.com/r/neutralinojs/" target="_blank" rel="noopener noreferrer" class="footer__link-item">Reddit</a></li></ul></div><div class="col footer__col"><h4 class="footer__title">更多</h4><ul class="footer__items"><li class="footer__item"><a href="https://github.com/neutralinojs/neutralinojs" target="_blank" rel="noopener noreferrer" class="footer__link-item">GitHub</a></li><li class="footer__item"><a href="https://www.patreon.com/shalithasuranga" target="_blank" rel="noopener noreferrer" class="footer__link-item">Patreon</a></li><li class="footer__item"><a class="footer__link-item" href="/zh-cn.neutralinojs.github.io/privacy-policy">隐私政策</a></li><li class="footer__item"><a href="https://codezri.org/blog/" target="_blank" rel="noopener noreferrer" class="footer__link-item">博客</a></li></ul></div></div><div class="footer__bottom text--center"><div class="footer__copyright">Copyright © 2024 Neutralinojs | innovation by <a href="https://codezri.org/">CodeZri.org</a></div></div></div></footer></div>
<script src="/zh-cn.neutralinojs.github.io/assets/js/styles.c25d7c9f.js"></script>
<script src="/zh-cn.neutralinojs.github.io/assets/js/runtime~main.da1bdab8.js"></script>
<script src="/zh-cn.neutralinojs.github.io/assets/js/main.22927eab.js"></script>
<script src="/zh-cn.neutralinojs.github.io/assets/js/1.a80d899d.js"></script>
<script src="/zh-cn.neutralinojs.github.io/assets/js/2.818fc9a7.js"></script>
<script src="/zh-cn.neutralinojs.github.io/assets/js/49.8e895b96.js"></script>
<script src="/zh-cn.neutralinojs.github.io/assets/js/50.816652b0.js"></script>
<script src="/zh-cn.neutralinojs.github.io/assets/js/935f2afb.a67ede05.js"></script>
<script src="/zh-cn.neutralinojs.github.io/assets/js/17896441.74f92a0c.js"></script>
<script src="/zh-cn.neutralinojs.github.io/assets/js/f2d4af26.54def32b.js"></script>
</body>
</html>